package com.itshizhan.lifecycledemo

import android.app.Activity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry

class MainActivity :AppCompatActivity() {

    private lateinit var lifecycleRegistry: LifecycleRegistry

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        //        lifecycleRegistry = LifecycleRegistry(this)
        //
        //        val myObserver = LocationObserver(lifecycle)
        //        lifecycle.addObserver(myObserver)
        lifecycle.addObserver(MyLifecycleObserver2())
    }


    //    override fun getLifecycle(): Lifecycle {
    //        return lifecycleRegistry
    //    }

}